// 图书信息
export interface Book {
  bookId: number
  bookName: string
  price: number
  cover?: string
}

// 购物车项
export interface CartItem {
  bookId: number
  bookName: string
  quantity: number
  price: number
}

// 购物车
export interface Cart {
  cartId: number
  username: string
  sum: number
  cartItemList: CartItem[]
}

// API 响应
export interface CartResponse {
  code: number
  msg: string | null
  data: Cart[]
}

// 更新购物车参数
export interface CartUpdateParams {
  user: {
    userId: number
  }
  book: {
    bookId: number
  }
  quantity: number
}

export interface CartAddParams {
  bookId: number
  quantity?: number
}

export interface CartVo {
  cartId: number
  username: string
  sum: number
  cartItemList: CartItem[]
}
